package com.wlc.base.array;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description map例子
 * @date 2021-09-01 10:22
 */
public class MapDemo {

    public static void main(String[] args) {
        bubbleSort();
    }

    /**
     * 冒泡排序
     */
    public static void bubbleSort() {
        int arr[] = {-5, 29, 7, 10, 5, 16};
        for (int i = 1; i < arr.length; i++) {
            for (int j = 0; j < arr.length - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp;
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(" " + arr[i] + " ");
        }
    }
}
